package com.hiwhitley.himei.module.video;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
 * Created by hiwhitley on 2016/9/24.
 */

public class VideoPagerAdapter extends FragmentPagerAdapter{
    private static final int PAGE_COUNT = 2;
    private String[] tabTitles = new String[]{"每日精选", "发现更多"};
    private Context context;

    public VideoPagerAdapter(FragmentManager fm, Context context) {
        super(fm);
        this.context = context;
    }

    @Override
    public Fragment getItem(int position) {
        switch(position){
            case 0:
                return DailyFragment.newInstance();
            default:
                return FindMoreFragment.newInstance();
        }

    }

    @Override
    public int getCount() {
        return PAGE_COUNT;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return tabTitles[position];
    }
}
